<template>
        <div class="first-loading-wrp">
            <h3>正在本地授权...</h3>
            <div class="loading-wrp">
                <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
            </div>
        </div>
</template>
<script>
    import { oauthWechatUser } from "../../api/login";
    export default {
        data() {
            this.asyncRequest()
            return {
            };
        },
        methods: {
            async asyncRequest() {
                await oauthWechatUser().then((res) => {
                    if (res.code == -5) { //  要重定向到主要的页面
                        this.$router.push(res.data)
                    }
                }).catch(err=> {
                    this.$router.push('/500')
                    console.log(err)
                })
            }
        },
        beforeCreate() {
        },
        created() {
        }
    };
</script>
<style>
</style>
